<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">


    <link href="css/style.css" rel="stylesheet">
    <link href="css/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
</head>

<body onload="userlogin()">



<!-- Placed js at the end of the document so the pages load faster -->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/modernizr.min.js"></script>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script type="text/javascript">



    window.onload = function () {
        userlogin();
    };


    function userlogin() {

        $.ajax({
            url: "/user/no_login",//url 统一资源定位符
            type: "POST",
            success: function (result) {

                if (result == 'error') {
                } else if (result.search('同学') != -1) {
                    window.sessionStorage.setItem("stu_u_name", result);
                    window.location.href = "index";
                } else if (result.search('账号禁用') != -1) {
                    return false;
                } else if (result.search('验证码错误') != -1) {
                    return false;
                } else {
                    return false;
                }
            },
            error: function (data) {

            }
        });
    }

    function insertuser() {
        window.location.href = "registration";
    }

    function loginTel() {
        window.location.href = "loginTel";
    }

    $(document).ready(function () {
        $('#checkcode').click(function () {
            $.ajax({
                url: 'image/getCheckCode',
                type: 'get',
                success: function (data, status, xhr) {
                    $('#checkcode').attr('src', 'getCheckCode');
                },
            });
        });
    });

</script>

</body>
</html>
